import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 04 - 16
 * Time: 12:34
 */
//猜数字
public class test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int randNum = random.nextInt(101);
        while(true) {
            System.out.println("请输入你要猜的数字：");
            int num = scanner.nextInt();
            if(num < randNum) {
                System.out.println("猜小了！");
            }else if(num == randNum) {
                System.out.println("猜对了");
                break;
            }else {
                System.out.println("猜大了");
            }
        }
        scanner.close();
    }
}
